package com.yanyeori.framework.core.thread;

import com.alibaba.ttl.TransmittableThreadLocal;

/**
 * 带名称标识的TransmittableThreadLocal
 * @author chenkuan
 * @date 2023/10/5
 */
public class NamedTransmittableThreadLocal<T> extends TransmittableThreadLocal<T> {
    private final String name;

    /**
     * Create a new NamedTransmittableThreadLocal with the given name.
     * @param name a descriptive name for this ThreadLocal
     */
    public NamedTransmittableThreadLocal(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return name;
    }
}
